package com.lyj.mode.strategy;

/**
 * 测试类
 * @author:liyajie
 * @createTime:2022/2/24 11:07
 * @version:1.0
 */
public class Test {
    public static void main(String[] args) {
        String cakeType = AppleCakeHandler.class.getSimpleName();
        CakeEnum cakeEnum = CakeEnum.match(cakeType);
        CakeHandler cakeHandler = cakeEnum.getCakeHandler();
        cakeHandler.makeCake();

        cakeType = BananaCakeHandler.class.getSimpleName();
        cakeEnum = CakeEnum.match(cakeType);
        cakeHandler = cakeEnum.getCakeHandler();
        cakeHandler.makeCake();
    }
}
